package com.usian.service.impl;

import com.baomidou.mybatisplus.core.injector.methods.UpdateById;
import com.usian.mapper.staff.StaffMapper;
import com.usian.pojo.staff.Staff;
import com.usian.service.StaffService;
import com.usian.vo.StaffVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffServiceImpl implements StaffService {

    @Autowired
    private StaffMapper staffMapper;

    @Override
    public List<StaffVo> findAll() {
        return staffMapper.findAll();
    }

    @Override
    public void add(Staff staff) {
        staffMapper.insert(staff);
    }

    @Override
    public void del(Integer id) {
        staffMapper.deleteById(id);
    }

    @Override
    public void upd(Staff staff) {
        staffMapper.updateById(staff);
    }

}
